package cn.lyjuan.android.demofive.ui.tab.tabhost3;

import android.app.Activity;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.Window;
import android.widget.TabHost;
import cn.lyjuan.android.demofive.R;

/**
 * Created by chad on 2016/3/3.
 */
public class TabHostActivity extends Activity
{
    @Override
    protected void onCreate(Bundle savedInstanceState)
    {
        this.requestWindowFeature(Window.FEATURE_NO_TITLE);

        super.onCreate(savedInstanceState);

        this.setContentView(R.layout.ui_tabhost3);

        TabHost th = (TabHost) this.findViewById(R.id.ui_tabhost3_tab);
        th.setup();//

        LayoutInflater lf = LayoutInflater.from(this);

        View first = lf.inflate(R.layout.ui_tabhost3_first, th.getTabContentView());
        View scond = lf.inflate(R.layout.ui_tabhost3_second, th.getTabContentView());

        th.addTab(th.newTabSpec("First1").setIndicator("First2").setContent(R.id.ui_tabhost3_first));
        th.addTab(th.newTabSpec("Second1").setIndicator("Second2").setContent(R.id.ui_tabhost3_second));
    }
}
